//
//  NSObject+Tool.m
//  网易新闻
//
//  Created by Yeewii@hotmail.com on 16/6/18.
//  Copyright © 2016年 Yeewii@hotmail.com. All rights reserved.
//

#import "NSObject+Tool.h"

@implementation NSObject (Tool)

+(NSString *)TimespStrTurnDate:(NSString *)TimespStr
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"YYYY-MM-dd"];
    NSTimeInterval timeLine = [[TimespStr substringToIndex:10]doubleValue];
    NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:timeLine];
    NSString *confromTimespStr = [formatter stringFromDate:confromTimesp];
    return confromTimespStr;
}


@end
